import request from '@/utils/request'
export function getDepartment() {
  return request({
    url: '/sys/user'
  })
}
export function getEmployeeList(params) {
  return request({
    url: '/sys/user',
    params
  })
}
export function exportEmployee() {
  return request({
    url: '/sys/user/export',
    responseType: 'blob'
  })
}
export function getExportTemplate() {
  return request({
    url: '/sys/user/import/template',
    responseType: 'blob'
  })
}
export function uploadExcel(data) {
  return request({
    url: '/sys/user/import',
    method: 'POST',
    data
  })
}
export function delEmployee(id) {
  return request({
    url: `/sys/role/${id}`,
    method: 'delete'

  })
}
export function addEmployee(data) {
  return request({
    url: '/sys/user',
    method: 'POST',
    data
  })
}
export function getEmployeeDetail(id) {
  return request({
    url: `/sys/user/${id}`
  })
}
export function updateEmployee(data) {
  return request({
    url: `/sys/user/${data.id}`,
    method: 'put',
    data
  })
}
export function getEnableRoleList() {
  return request({
    url: '/sys/role/list/enabled'
  })
}
export function assignRole(data) {
  return request({
    url: '/sys/user/assignRoles',
    method: 'put',
    data
  })
}
